import React, {Component} from "react"
import { Route, withRouter, HashRouter,Switch} from "react-router-dom"
import {connect} from "react-redux"
import Login from "app/login"
import AppContainer from "app/appContainer"
import Base from "app/Base"
@withRouter
@connect((state) => ({
  state
}))
export default class App extends Component {
  render() {
    return (
      <div>
        <Switch>
          <Route  exact path="/" component={Login} />
          <Route  exact path="/login" component={Login} />
          <Route  path="/index" component={AppContainer} />
          <Route  path="/base" component={Base} />
        </Switch>
      </div>
    )
  }
  componentWillMount() {
    const {replace, location} = this.props.history
    replace(location)
  }
}
